/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2019-09-22     Warfalcon    first version
 */

#include <rtthread.h>


#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
#include <finsh.h>
#include <shell.h>
#endif

#define DBG_ENABLE
#define DBG_SECTION_NAME                    "main"

#ifdef RT_MAIN_DEBUG
#define DBG_LEVEL                           DBG_LOG
#else
#define DBG_LEVEL                           DBG_INFO
#endif

#define DBG_COLOR
#include <rtdbg.h>

const char boot_log_buf[] = 
"\r\n\
 ____ _____      _____ ___  _____  _        \r\n\
|  _ \\_   _|	|  ___/ _ \\ _   _|/ \\      \r\n\
| |_) || |_____ | |_  || ||  | | / _ \\      \r\n\
|  _ < | |_____ |  _| ||_||  | |/ ___ \\     \r\n\
|_| \\_\\|_|	|_|   \\___/  |_/_/   \\_\\  \r\n";





void rt_fota_print_log(void)
{   
    LOG_RAW("%s", boot_log_buf);   
	LOG_RAW("2022 - 2042 Copyright \r\n\r\n");
	LOG_RAW("Version: \r\n- %s. build %s\r\n", RT_FOTA_SW_VERSION, __DATE__);
    LOG_RAW("CPUInfo:\r\n- AT32F403ARCT7 \r\n- ARM 32-bit Cortex-M4 Microcontroller,  (Up to 240 MHz max)\r\n");
    LOG_RAW("Memories:\r\n- Up to 1024 Kbytes of Flash memory \r\n- Up to 224 Kbytes of SRAM\r\n");
    LOG_RAW("BoardName:\r\n- %s board\r\n",RT_FOTA_APP_PART_NAME);    
}

int main(void)
{    
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
	finsh_set_prompt("rt-fota />");
#endif
    
    extern void rt_fota_init(void);
    rt_fota_init();

    return RT_EOK;
}

